package com.sweet.thread;

// 模拟倒计时
public class TestSleep2 {
    public static void main(String[] args) {
        revertTime(10);
    }
    static void revertTime(int num) {
        while (num >= 0) {
            System.out.println(num--);
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
